package com.lxd.mapper;

import com.lxd.entity.po.File;
import com.lxd.entity.query.FileQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FileMapper {
    void insert(File file);
    
    File selectById(Long id);
    
    File selectLatest();
    
    int selectCount(FileQuery query);
    
    List<File> selectList(FileQuery query);
    
    void deleteById(Long id);

    /**
     * 根据关联ID和类型获取最新的一张图片
     */
    File selectLatestByRelatedId(@Param("relatedId") Long relatedId, @Param("relatedType") Integer relatedType);
} 